package com.platform.server.controller;

import com.platform.server.dao.MessageDao;
import com.platform.server.dao.PayOrderDao;
import com.platform.server.dao.ServerDao;
import com.platform.server.dao.UserDao;
import com.platform.server.dao.VipDao;
import com.platform.server.service.PayOrderService;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

/**
 * Created by Administrator on 2017/5/17 0017.
 */
@RequestMapping(value = "/payorder")
@Controller
public class PayOrderController extends BaseController {

    @Autowired
    private PayOrderService payOrderService;


    @Autowired
    private PayOrderDao payOrderDao;

    @Autowired
    private ServerDao serverDao;

    @Autowired
    private UserDao userDao;

    @Autowired
    private VipDao vipDao;

    @Autowired
    private MessageDao messageDao;


    /**
     * 微信回调
     */
    @RequestMapping(value = "/wxNotify")
    @ResponseBody
    public void wxNotify(HttpServletResponse response) throws Exception {
        payOrderService.wxNotify(request, response);
    }

    /**
     * 支付宝回调
     */
    @RequestMapping(value = "/aliNotify")
    @ResponseBody
    public Object aliNotify(HttpServletResponse response) throws Exception {
        return payOrderService.aliNotify(request, response);
    }

    /**
     * 优惠券微信回调
     */
    @RequestMapping(value = "/wxNotify2")
    @ResponseBody
    public void wxNotify2(HttpServletResponse response) throws Exception {
        payOrderService.wxNotify2(request, response);
    }

    /**
     * 优惠券支付宝回调
     */
    @RequestMapping(value = "/aliNotify2")
    @ResponseBody
    public Object aliNotify2(HttpServletResponse response) throws Exception {
        return payOrderService.aliNotify2(request, response);
    }

    /**
     * 违约金微信回调
     */
    @RequestMapping(value = "/wxNotify3")
    @ResponseBody
    public void wxNotify3(HttpServletResponse response) throws Exception {
        payOrderService.wxNotify3(request, response);
    }

    /**
     * 违约金支付宝回调
     */
    @RequestMapping(value = "/aliNotify3")
    @ResponseBody
    public Object aliNotify3(HttpServletResponse response) throws Exception {
        return payOrderService.aliNotify3(request, response);
    }

    /**
     * 支付服务微信回调
     */
    @RequestMapping(value = "/wxNotify4")
    @ResponseBody
    public void wxNotify4(HttpServletResponse response) throws Exception {
        payOrderService.wxNotify4(request, response);
    }

    /**
     * 支付服务支付宝回调
     */
    @RequestMapping(value = "/aliNotify4")
    @ResponseBody
    public Object aliNotify4(HttpServletResponse response) throws Exception {
        return payOrderService.aliNotify4(request, response);
    }

    /**
     * 支付服务微信回调
     */
    @RequestMapping(value = "/wxNotify5")
    @ResponseBody
    public void wxNotify5(HttpServletResponse response) throws Exception {
        payOrderService.wxNotify5(request, response);
    }

    /**
     * 支付服务支付宝回调
     */
    @RequestMapping(value = "/aliNotify5")
    @ResponseBody
    public Object aliNotify5(HttpServletResponse response) throws Exception {
        return payOrderService.aliNotify5(request, response);
    }


}
